﻿using System.Windows;
using WpfApp.Views;

namespace WpfApp
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            LoginView login = new LoginView();
            login.ShowDialog();
            if (!login.DialogResult.Value) { Close(); }
            InitializeComponent();
        }

        private void BtnConvert_Click(object sender, RoutedEventArgs e)
        {
            ConvertView view = new ConvertView();
            //设置所属窗体，避免子窗体被隐藏到主窗体后面
            view.Owner = this;
            //false表示不显示新的窗口，默认当前打开窗口为一个子窗口（不会显示两个窗口）
            view.ShowInTaskbar = false;
            view.ShowDialog();
        }

        private void BtnBind_Click(object sender, RoutedEventArgs e)
        {
            BindView view = new BindView();
            view.ShowDialog();
        }

        private void BtnCommand_Click(object sender, RoutedEventArgs e)
        {
            CommandView view = new CommandView();
            view.ShowDialog();
        }

        private void BtnTrigger_Click(object sender, RoutedEventArgs e)
        {
            TriggerView view = new TriggerView();
            view.ShowDialog();
        }

        private void BtnListView_Click(object sender, RoutedEventArgs e)
        {

        }

        private void BtnDataGrid_Click(object sender, RoutedEventArgs e)
        {
            DataGridView view = new DataGridView();
            view.Owner = this;
            view.ShowDialog();
        }

        private void BtnControl_Click(object sender, RoutedEventArgs e)
        {
            ControlView view = new ControlView();
            view.ShowDialog();
        }
    }
}
